/**
  * Created by liyun on 2017/2/14.
  * Author: yunpengl@genice.cc
  * Date: 2017/2/14
  * Time: 9:50
  * 
  */


'use strict';
var redis = require("redis");
var settings = require('../config/settings'),
    redis_conf = settings.redis_conf;
const log = require('log4js').getLogger("redisClient");
var redisClient = redis.createClient(redis_conf.port, redis_conf.host, {db: 3});//创建redis连接，选择数据库2
redisClient.on("error", function (err) {
    if (!process.env.NODE_ENV) {
        log.error('/login.redisClient start: ' + err);
    } else {
        log.debug('/login.redisClient start: ' + err);
    }
});

module.exports = redisClient;